home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: merlin.hgc.edu!weat4122
- From: weat4122@hgc.edu (gerard weatherby)
- Subject: Re: help on syntax
- Message-ID: <1996Jan11.021442.24336@merlin.hgc.edu>
- Sender: usenet@merlin.hgc.edu (Action News Central)
- Organization: The Hartford Graduate Center
- References: <4cd5io$7qg@news1.usa.pipeline.com>
- Date: Thu, 11 Jan 1996 02:14:42 GMT
-
- In article <4cd5io$7qg@news1.usa.pipeline.com> grantp@usa.pipeline.com(Pete) writes:
- >On Jan 02, 1996 22:27:28 in article <help on syntax>, 'Paul Abrilla
- ><APCCU@CUNYVM.CUNY.EDU>' wrote:
- >
- >
- >>I'm trying to run a simple program, but I'm getting a 'misplaced
- >>else' error everytime I compile it. [... rest deleted ..]
- >
- >Read up on the use of braces.
- >>
- >>if (c = (a-b))
- > { // Ya needs one here
- >>cout << "a: ";
- >>cout << a;
- >>cout << " minus b: ";
- >>cout << b;
- >>cout << " quals c: ";
- >>cout << c << endl;
- > } // and here
- >>else
- >>cout << "a-b does not equal c: " << endl;
- >>
- >
- >--
- >
- >Pete
- >
- ---------
- or more simply...
-
- if (c == (a-b))
- cout << "a: "
- << a
- << " minus b: "
- << b
- << " quals c: "
- << c << endl;
- else
- cout << "a-b does not equal c: " << endl;
-
-
-